package org.example.demosystem.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.*;
import org.example.demosystem.entity.Student;

@Mapper
public interface StudentMapper {

    /**
     * 分页查询学生信息
     */
    @Select("SELECT * FROM student")
    Page<Student> selectPage(Page<Student> page, @Param("name") String name);

    @Delete("DELETE FROM student WHERE sno = #{sno}")
    void deleteById(int sno);

    /**
     * 添加学生*/
    @Insert("INSERT INTO student(sno,sname,Ssex,sage,sdept) VALUES(#{sno},#{sname},#{Ssex},#{sage},#{sdept})")
    void save(Student student);
}
